package com.dns.reset.web.repository;

import com.dns.reset.web.model.DbTelnetEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.Date;
import java.util.List;

public interface DbTelnetRepository extends JpaRepository<DbTelnetEntity,String> {
    @Query(value = "update db_telnet set is_exist=0,destroy_time=?1 where is_exist=1 ",nativeQuery = true)
    @Modifying
    public Integer updateIsExistAndDestroyTime(Date destroyTime );

    public List<DbTelnetEntity> findByIsExist(Integer isExist);
}
